﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Xna.Framework.Graphics
{
	/// <summary>
	/// Represents a collection of Texture objects.
	/// </summary>
	public sealed class TextureCollection
	{
		List<Texture> _textures;

		/// <summary>
		/// Gets or sets the Texture at the specified sampler number.
		/// </summary>
		/// <param name="index">Zero-based sampler number. Textures are bound to samplers; samplers define sampling state such as the filtering mode and the address wrapping mode. Programmable shaders reference textures using this sampler number.</param>
		public Texture this[int index]
		{
			get { return _textures[index]; }
			set { _textures[index] = value; }
		}

		internal TextureCollection()
		{
			_textures = new List<Texture>();
		}

		internal void Add(Texture item)
		{
			_textures.Add(item);
		}

		internal bool Contains(Texture item)
		{
			return _textures.Contains(item);
		}

		internal int Count
		{
			get { return _textures.Count; }
		}

		internal bool Remove(Texture item)
		{
			return _textures.Remove(item);
		}
	}
}
